/*
 * @Author: your name
 * @Date: 2021-02-27 23:28:16
 * @LastEditTime: 2021-07-20 18:22:38
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \vue3-antd-koa\koa-api\src\middlewares\index.js
 */
const errorHandler = require("./handler/error");
const log4js = require("koa-log4")

// 添加用于获取请求的body 添加该插件之后 就可以通过ctx.request.body获取传过来的参数
const bodyParser = require("koa-body")

module.exports = [
    log4js.koaLogger(log4js.getLogger("http"), {
        level: "auto"
    }),
    errorHandler(),
    bodyParser()
]